class OrdersService {
  async getOrders(params = {}) {
    const { page = 1, pageSize = 10, status, orderNumber, memberId, dateRange } = params;
    
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: {
            list: [],
            total: 0,
            page,
            pageSize
          },
          message: 'success'
        });
      }, 500);
    });
  }

  async getOrderById(id) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: null,
          message: 'success'
        });
      }, 300);
    });
  }

  async updateOrder(id, data) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: { ...data, id },
          message: '订单更新成功'
        });
      }, 500);
    });
  }

  async deleteOrder(id) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: null,
          message: '订单删除成功'
        });
      }, 500);
    });
  }

  async updateOrderStatus(id, status) {
    return new Promise((resolve) => {
      setTimeout(() => {
        resolve({
          code: 200,
          data: { id, status },
          message: '订单状态更新成功'
        });
      }, 500);
    });
  }
}

export default new OrdersService();
